---
layout: example
categories: example/v1.0.0
version: v1.0.0
title: Toggling baselayers
description: Toggling between three different baselayers.
tags:
  - ui
  - layers
---

<div id='map'></div>

<script>
  var map = L.mapbox.map('map', null, {
      maxZoom: 18
  }).setView([22.76, -25.84], 3);

  var layers = {
      Streets: L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'),
      Light: L.mapbox.styleLayer('mapbox://styles/mapbox/light-v10'),
      Satellite: L.mapbox.styleLayer('mapbox://styles/mapbox/satellite-v9')
  };

  layers.Streets.addTo(map);
  L.control.layers(layers).addTo(map);
</script>
